import request from '@/config/axios'

export interface ProductionSendVO {
  id: number
  sendNumber: string
  inventoryId: number
  inventoryNumber: string
  orderNumber: string
  dictSendType: number
  customerName: string
  productNumber: string
  productName: string
  productStandard: string
  productSize: string
  trainNumber: string
  proportionExpenses: string
  customerAddress: string
  packingAddress: string
  requirements: string
  dictSendStatus: number
  loadingStartTime: Date
  loadingEndTime: Date
  creatorName: string
  updaterName: string
}

// 查询生产管理--产品管理—发货申请列表
export const getProductionSendPage = async (params) => {
  return await request.get({ url: `/produce/production-send/page`, params })
}

// 查询生产管理--产品管理—发货申请详情
export const getProductionSend = async (id: number) => {
  return await request.get({ url: `/produce/production-send/get?id=` + id })
}

// 新增生产管理--产品管理—发货申请
export const createProductionSend = async (data: ProductionSendVO) => {
  return await request.post({ url: `/produce/production-send/create`, data })
}

// 修改生产管理--产品管理—发货申请
export const updateProductionSend = async (data: ProductionSendVO) => {
  return await request.put({ url: `/produce/production-send/update`, data })
}

// 提交生产管理--产品管理—发货申请
export const submitProductionSend = async (data: ProductionSendVO) => {
  return await request.post({ url: `/produce/production-send/submit`, data })
}

// 作废生产管理--产品管理—发货申请
export const cancelProductionSend = async (data: ProductionSendVO) => {
  return await request.post({ url: `/produce/production-send/cancel`, data })
}

// 导出生产管理--产品管理—发货申请 Excel
export const exportProductionSend = async (data) => {
  return await request.download({ url: `/produce/production-send/export-excel`, data })
}
